package com.zhouixi.entity;

import lombok.Data;

@Data
public class Message {
    private String msgId; // 消息唯一ID
    private Long senderId; // 发送者ID
    private Long receiverId; // 接收者ID（用户或群组）
    private String content; // 消息内容
    private Integer type; // 消息类型：文本、图片、语音等
    private Long timestamp; // 发送时间戳
    private Integer status; // 消息状态：发送中、已发送、已接收、已读
    private String extra; // 额外信息（如图片URL）

    public enum MessageType {
        TEXT(1,"文本"),
        IMAGE(2,"图像"),
        VOICE(3,"语音"),
        SYSTEM(4,"系统消息");

        private String desc ;
        private Integer code ;

        MessageType(Integer code,String desc) {
            this.desc = desc;
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }

    }

    public enum MessageStatus {
        SENDING(1,"发送中"),
        SENT(2,"已发送"),
        RECEIVED(3,"已接收"),
        READ(4,"已读");

        private String desc ;
        private Integer code ;

        MessageStatus(Integer code,String desc) {
            this.desc = desc;
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }
}